package com.note7_5;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.Scanner;

public class Question1 {
	
	/**
	 * 输入一个文件名，把其内容用byte的方式输出，用单字节的方式
	 * 
	 * 问题：文字乱码
	 */
	
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		System.out.println("请输入文件位置：");
		String path = in.nextLine();
		InputStream is = null;
		try{
			is = new FileInputStream(path);
			int len = -1;
			while((len = is.read()) > -1){
				System.out.println((char)len);
			}
		}catch(FileNotFoundException e){
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
